<template>
  <div>
    <div class="Headbox">
      <b>操作日志</b>
    </div>
    <div class="bodybox">
      <el-table
        :data="DataAll"
        height="500"
        border
        style="width: 100%"
      >
        <el-table-column
          prop="operateId"
          label=""
          width="50"
        />
        <el-table-column
          prop="staffId"
          label="操作人员"
          width="380"
        />
        <el-table-column
          prop="recordItem"
          label="操作详情"
          width="380"
        />
        <el-table-column
          prop="recordTime"
          label="操作时间"
        />
      </el-table>
    </div>
    <!-- 分页 -->

  </div>
</template>

<script>
import { examine } from '@/api/activityCharge'

export default {
  name: 'User',
  data() {
    return {
      DataAll: []
    }
  },
  mounted() {
    this.examine()
  },
  methods: {
    // 查询操作日志
    examine() {
      examine().then(res => {
        this.DataAll = res.data
        for (var i = 0; i < this.DataAll.length; i++) {
          if (this.DataAll[i].staffId === 1) {
            this.DataAll[i].staffId = '管理员'
          } else if (this.DataAll[i].staffId === 2 || this.DataAll[i].staffId === 7) {
            this.DataAll[i].staffId = '经理'
          }
        }
      })
    }
  }
}
</script>

<style lang="scss">
.Headbox{
    margin-left: 5%;
    margin-top: 2%;
}
.bodybox{
    width: 90%;
    margin: 0 auto;
    margin-top: 2%;
}
</style>
